< previous page page_14 next page >

Page 14
position. In contrast, to move a drawing that you have drawn directly on a form, you would need to modify the drawing source code.
Printer objects represent printers attached to your computer. By drawing to a printer object and then telling the object you are finished, you can print text and graphics.
Forms, picture boxes, and printers all provide the graphic methods shown in Table 1.2.
Forms and picture boxes also provide a Cls method that clears the drawing area. These methods are described in detail in the following sections.
Line Method
The Line method allows you to draw line segments using the following syntax:
Line Step(x1, y1)-Step(x2, y2), color, BF
Step
If you include the first Step keyword, the coordinates of the line's starting point are relative to the end of your last drawing command. If you just finished drawing a line that ended at (100, 100), and you now specify x1 = 10 and y1 = 50, this line starts at (110, 150).
(x1, y1)
The coordinate of the point at which the line should start. If you omit this point, the line starts where the previous drawing command ended.
Step
If you include the second Step keyword, the coordinates of the line's ending point are relative to the line's starting point.
(x2, y2)
The coordinate of the point at which the line should end.
color
The color the line should have.
B
If you include the B flag, the Line method draws a box with corners at the start and end points.
F
If you include the F flag, the Line command fills the box with corners at the start and end points, using the same color used to draw the box. If you use the F flag, you must also include the B flag.

A common reason to omit the line's starting point is to draw a sequence of connected line segments like this:
Table 1.2 Graphic Methods for Objects
METHODPURPOSE
LineDraws a line, rectangle, or filled box
CircleDraws a circle or ellipse, or an arc of a circle or ellipse
PaintPictureCopies a picture from one control to another
PSetSets the color of a specified point
PointReturns the color of a specified point
PrintDisplays text

 
< previous page page_14 next page >